<%@page import="java.util.Date"%>
<%@page import="com.sinba.common.system.service.IOrderService"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import="com.sinba.common.utils.Verification"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:setLocale value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
	<fmt:setBundle basename="i18n.itilbase"/>
	<c:set var="lang" value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
<%--
 Created by IntelliJ IDEA.
 User: Bluewater
 Date: 2005-7-21
 Time: 20:55:45
 To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //字符编码
    String CharacterEncoding = "UTF-8";
    request.setCharacterEncoding(CharacterEncoding);
    String BillNo = request.getParameter("BillNo");
    String Amount = request.getParameter("Amount");
    String tradeOrder = request.getParameter("tradeOrder");
    String Succeed = request.getParameter("Succeed");
    String Result = request.getParameter("Result");
    String MD5info = request.getParameter("MD5info");
    String MD5key = "sjPF}L{i";
    String Currency="";
    Verification md5 = new Verification();
    String md5src = BillNo + Currency + Amount + Succeed + MD5key;
    //System.out.println("BillNo:"+BillNo);
    //System.out.println("Amount:"+Amount);
    //System.out.println("tradeOrder:"+tradeOrder);
    //System.out.println("MD5info:"+MD5info);
    //System.out.println("md5src:"+md5src);
    
    System.out.println("---------------Start-------------------");
    System.out.println("订单号:"+BillNo+",时间:"+new Date()+",Succeed:"+Succeed);
    System.out.println("订单号:"+BillNo+",时间:"+new Date()+",Result:"+Result);
    if("88".equals(Succeed) && ("Success".equals(Result) || "SUCCESS".equals(Result))){
    	System.out.println("---------------更新订单号:"+BillNo+"-------------------");
    	ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
        IOrderService orderService = (IOrderService)ac.getBean("orderService");
        orderService.updateOrder(BillNo);
    }
    System.out.println("---------------END-------------------");
%>

<html>
<head><title><fmt:message key="i18n.payResult"/></title></head>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="styles/index.css" />
<body style="height:800px">

</body>

</html>

